﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KoolearnSample.Model
{
    /// <summary>
    /// 回答列表
    /// </summary>
    [DataContract]
    public class KoolearnExamAnswer : INotifyPropertyChanged
    {
        #region Members
        [DataMember(Name = "answer")]
        private string answer;
        [DataMember(Name = "correct")]
        private string correct;
        [DataMember(Name = "option")]
        private string option;
        [DataMember(Name = "score")]
        private string score;
        #endregion

        #region Properties
        public string Answer
        {
            get { return answer; }
            set { answer = value; RaisePropertyChanged("Answer"); }
        }
        public string Correct
        {
            get { return correct; }
            set { correct = value; RaisePropertyChanged("Correct"); }
        }
        public string Option
        {
            get { return option; }
            set { option = value; RaisePropertyChanged("Option"); }
        }
        public string Score
        {
            get { return score; }
            set { score = value; RaisePropertyChanged("Score"); }
        }
        #endregion

        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Methods
        public void RaisePropertyChanged(string name)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
        #endregion
    }
}
